import React, { Component } from 'react'
import CounterButton from './c-cpns/CounterButton'

export class App extends Component {
    constructor(){
        super()
        this.state={
            counter:100
        }
    }
  render() {
    const {counter}=this.state
    return (
      <div>
        <h1>当前计数:{counter}</h1>
        <CounterButton addClick={(count)=>{this.setState({counter:count+counter})}} subClick={(count)=>this.setState({counter:counter-count})}></CounterButton>
      </div>
    )
  }
}

export default App
